<!doctype html>
<title>Change of viewport affecting mask content</title>
<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#the-mask-image">
<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#svg-masks">
<link rel="match" href="../clip-path/reference/green-100x100.html">
<div id="container" style="width: 0%">
  <svg style="width: 100%">
    <mask id="mask">
      <rect width="100%" height="100%" fill="white"/>
    </mask>
    <rect width="100" height="100" fill="red"/>
    <rect width="100" height="100" fill="green" mask="url(#mask)"/>
  </svg>
</div>
<script>
  document.body.offsetTop;
  document.getElementById('container').style.width = '100%';
</script>
